package com.common.exception;
 
/**
 * Service层异常处理
 * 
 * @author fitch
 * @createtime 2012-12-14 下午5:25:00
 * @version 1.0
 */
public class ServiceException extends BaseException {
	private static final long serialVersionUID = 1L;

	public ServiceException() {
	}

	public ServiceException(Exception e) {
		if (e instanceof BaseException) {
			this.setSuperException((BaseException) e);
		} else {
			setException(e);
			setErrorLevel(SERVICELEVEL);
			setDetailMessage(SERVICEERRORINFO); e.printStackTrace();
		}
	}

	public ServiceException(Exception e, String className) {
		if (e instanceof BaseException) {
			this.setSuperException((BaseException) e);
		} else {
			setException(e);
			setErrorLevel(SERVICELEVEL);
			setDetailMessage(SERVICEERRORINFO);e.printStackTrace();
		}
	}

	public ServiceException(Exception e, Class<?> c) {
		if (e instanceof BaseException) {
			this.setSuperException((BaseException) e);
		} else {
			setException(e);
			setErrorLevel(SERVICELEVEL);
			setDetailMessage(SERVICEERRORINFO); e.printStackTrace();
		}
	}
}
